package com.itheima.shop.decorator;

import com.itheima.shop.domain.Order;
import org.springframework.stereotype.Component;

/**
 * @program: design
 * @description:
 * @author: zhanghz001
 * @create: 2020-12-15 12:15
 **/
@Component("fullMoneySum")
public class FullMoneySum extends DecoratorMoneySum {
    
    @Override
    public void money(Order order) {
        super.money(order);
        
        //执行增强
        fullMoneySum(order);
        
    }
    
    //满100-10
    private void fullMoneySum(Order order) {
        if (order.getMoney() >= 100) {
            order.setPaymoney(order.getPaymoney() - 10);
        }
    }
}
